home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / code / contr / setup.exe / Disk1 / data1.cab / Configuration_En / Menus / MM / ToggleBreakpoint.js < prev    next >
Encoding:
JavaScript  |  2003-07-18  |  854 b   |  33 lines

  1. // Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2.  
  3. function toggleBreakpoint()
  4. {
  5.    var doc = dw.getDocumentDOM('document');
  6.    if (doc)
  7.    {
  8.       var line = doc.getLineFromOffset(doc.source.getSelection()[0]);
  9.       doc.setBreakpoint(line, !doc.getBreakpoint(line));
  10.    }
  11. }
  12.  
  13. function canAcceptCommand()
  14. {
  15.    return dw.getFocus() == 'textView' ||
  16.             (dw.getFocus() == 'none' && dw.getDocumentDOM() != null && dw.getDocumentDOM('document').getFocus() != 'frameset');
  17. }
  18.  
  19. function setMenuText()
  20. {
  21.    var doc = dw.getDocumentDOM('document');
  22.    if (doc)
  23.    {
  24.       var line = doc.getLineFromOffset(doc.source.getSelection()[0]);
  25.       if ( !doc.getBreakpoint(line) )
  26.          return MENU_SetBreakpoint;
  27.       else
  28.          return MENU_RemoveBreakpoint;
  29.    }
  30.    else
  31.       return MENU_SetBreakpoint;
  32. }
  33.